feat(provider): native Ollama provider for local models - #119
Merged
Conversation
Roll the changelog into the 0.6.0 section and bump the version markers across the runtime and both SDKs. - CHANGELOG.md: [Unreleased] → [0.6.0] (2026-06-13) + fresh [Unreleased]; links. - internal/version: 0.5.1-dev → 0.6.1-dev (un-stamped local builds). - sdks/python: 0.5.0 → 0.6.0 (pyproject + __init__). - sdks/typescript: 0.5.0 → 0.6.0 (package.json + lockfile, version-only). - docs/VISION: status line → v0.6.0. The 0.6.0 line: Slack approvals, policy-as-code (POST /v1/policies + riskkernel.yaml + dry-run), the compliance evidence export, and the published enforcement-overhead number + public roadmap.
Replace the Ollama stub with a real provider against Ollama's /api/chat (non-streaming). System prompt leads as a system message, MaxTokens maps to num_predict, and token usage comes from prompt_eval_count / eval_count so the governor and cost ledger meter local runs exactly like hosted ones. It's key-free (local) and honors ctx, so the kill switch and time budget interrupt an in-flight generation. RISKKERNEL_OLLAMA_BASE_URL points it at a remote server (default http://localhost:11434); empty uses the local default. Budgets, the proxy, audit, and crash-resume all work unchanged for ollama runs — set RISKKERNEL_DEFAULT_PROVIDER=ollama. Tests cover the happy path (request shape + usage mapping against a mock server), a surfaced API error, and the base-URL default/trim. Bedrock remains the one stub.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the Ollama stub with a real provider — run local models through RiskKernel with the same budgets, proxy, audit trail, and crash-resume as a hosted provider. Closes #23.
RISKKERNEL_DEFAULT_PROVIDER=ollama riskkernel serve # key-free, local/api/chat(non-streaming). System prompt leads as asystemmessage;MaxTokens→num_predict;Temperaturepassed through.prompt_eval_count/eval_count, so the governor meters and the cost ledger prices local runs exactly like hosted ones (a local model is typically $0, which the pricing table already handles).ctx-aware — the kill switch and time budget interrupt an in-flight generation.RISKKERNEL_OLLAMA_BASE_URLpoints it at a remote Ollama (defaulthttp://localhost:11434).Bedrock remains the one stub. Tests cover the happy path (request shape + usage mapping against a mock server), a surfaced API error, and the base-URL default/trim.
go vetclean; full suite green.Based on the v0.6.0 release branch (#118) so its CHANGELOG sits in the post-release
[Unreleased]. Once #118 merges I'll rebase this ontomain(drops the release commit, no CHANGELOG conflict). It targets the next release.